using System;
using System.Collections.Generic;
using System.Text;

namespace MspEmulator
{
    class makeShutdown : ISend, IMakeShutdown, IUpdateDevice
    {
        public void Send()
        {
            Serial.Send(Utility.buildPack(Utility.collectData((byte)Utility.functCode.Shutdown)));
        }

        #region IMakeShutdown Members

        public void Make()
        {
            Serial.Send(Utility.buildPack(Utility.collectData((byte)Utility.replyesAsync.systemShutdowned)));
        }

        #endregion

        #region IUpdateDevice Members

        public void updateDevice()
        {
            Device.sysState = (byte)Utility.systemStates.Shutdown;
            Device.highVoltageOn = false;
        }

        #endregion
    }
}
